package com.learn.training.multithread.chapter7.demo1;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService es = Executors.newFixedThreadPool(6);
        for(int i =0; i < 6; i++){
            es.submit(new Task("task" + i));
        }
        // 这里的线程池会一直存在，直到调用shutdown()方法，才会关闭
        es.shutdown();
        //关闭线程池
    }
}
